<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateQaecmsVideosTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('qaecms_videos', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('视频id');
            $table->string('title')->comment('视频标题');
            $table->integer('type')->comment('视频分类');
            $table->integer('sid')->comment('视频资源id');
            $table->integer('stid')->comment('视频资源分类ID');
            $table->string('stype')->comment('视频资源分类名称');
            $table->string('lang')->comment('视频语言')->default('未知')->nullable();
            $table->string('area')->comment('视频区域')->default('未知')->nullable();
            $table->string('year')->comment('视频年份')->default('1970')->nullable();
            $table->string('note')->comment('视频清晰度')->default('未知')->nullable();
            $table->integer('score')->comment('评分')->default('0')->nullable();
            $table->mediumText('actor')->comment('视频演员')->nullable();
            $table->mediumText('director')->comment('视频导演')->nullable();
            $table->mediumText('introduction')->comment('视频简介')->nullable();
            $table->mediumText('seokey')->comment('视频seo关键字用逗号隔开')->nullable();
            $table->mediumText('thumbnail')->comment('视频缩略图')->nullable();
            $table->string('shost',200)->comment('视频来源host')->nullable();
            $table->longText('content')->comment('视频地址')->nullable();
            $table->string('editor')->comment('视频作者名称')->default('system');
            $table->tinyInteger('status')->comment('视频状态 1=已发布 2=草稿')->default(2);
            $table->tinyInteger('vip')->comment('浏览所需等级 0普通会员 1VIP用户')->default(0);
            $table->integer('integral')->comment('浏览所需积分')->default(0);
            $table->bigInteger('visitors')->comment('浏览人数')->default(0);
            $table->dateTime('deleted_at')->comment('软删除时间')->nullable();
            $table->dateTime('last')->comment('视频资源最后更新时间');
            $table->string('onlykey')->comment('视频唯一值')->unique('');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('qaecms_videos');
    }
}
